<!DOCTYPE html>
<html lang="zh">
<#assign ctx=springMacroRequestContext.contextPath/>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${stock.name}</title>
    <link rel="stylesheet" href="${ctx}/css/bootstrap-3.3.4.css">
    <script type="text/javascript" src="${ctx}/js/jszip.min.js"></script>
    <script type="text/javascript" src="${ctx}/js/FileSaver.js"></script>
    <script type="text/javascript" src="${ctx}/js/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="${ctx}/js/excel-gen.js"></script>
    <link rel="stylesheet" href="${ctx}/css/base.css" type="text/css"/>
    <script type="text/javascript" src="${ctx}/js/tablesMergeCell.js"></script>


    <style>

        td {
            text-align: center;
        }

        th {
            text-align: center;
        }
    </style>
</head>

<body>

<div class="container">
    <h2>${stock.name}数据分析结果</h2>

    <h3>基础指标分析</h3>

    <div class="row">
        <div class="col-md-10"><h4>基础数据</h4>
        </div>
        <div class="col-md-2">
            <button type="button" class="btn btn-success btn-block" id="jczb-generate-excel"><i
                        class="fa fa-file-excel-o"
                        aria-hidden="true"></i>
                下载
            </button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-bordered table-striped table-hover" id="jczb_table">
                    <thead>
                    <tr>
                        <th>年份</th>
                        <th>营业收入</th>
                        <th>应收账款</th>
                        <th>存货</th>
                        <th>流动比率</th>
                        <th>净利润</th>
                        <th>经营活动产生的现金流净额</th>
                        <th>资本开支</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if sourceList??>
                        <#list sourceList as item>
                            <tr>
                                <td>${item.year}年</td>
                                <td>${item.yysy}</td>
                                <td>${item.yszk}</td>
                                <td>${item.ch}</td>
                                <td>${item.ldbl}</td>
                                <td>${item.jly}</td>
                                <td>${item.jyhdxjlje}</td>
                                <td>${item.zbkz}</td>
                            </tr>
                        </#list>
                    </#if>
                    </tbody>
                </table>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-md-10"><h4>定理分析</h4>
        </div>
        <div class="col-md-2">
            <button type="button" class="btn btn-success btn-block" id="dlfx-generate-excel"><i
                        class="fa fa-file-excel-o"
                        aria-hidden="true"></i>
                下载
            </button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-bordered table-striped table-hover" id="dlfx_table">
                    <thead>
                    <tr>
                        <th>年份</th>
                        <th>营业收入增长量</th>
                        <th>应收账款增长量</th>
                        <th>存货增长量</th>
                        <th>营收增长量大于应收款增长量</th>
                        <th>营收增长量大于存货增长量</th>
                        <th>流动比率大于1</th>
                        <th>经营活动产生的现金流净额大于净利润</th>
                        <th>自由现金流为正</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if indexAnalysisList??>
                        <#list indexAnalysisList as item>
                            <tr>
                                <td>${item.year}年</td>
                                <td>${item.yysrzzl}</td>
                                <td>${item.yszkzzl}</td>
                                <td>${item.chzzl}</td>
                                <td class="<#if item.yszzldyysk> success <#else>danger </#if>">${item.yszzldyyskres}</td>
                                <td class="<#if item.ldbldy> success <#else>danger </#if>">${item.yszzldychres}</td>
                                <td class="<#if item.ldbldy> success <#else>danger </#if>">${item.ldbldyres}</td>
                                <td class="<#if item.xjljedyjly> success <#else>danger </#if>">${item.xjljedyjlyres}</td>
                                <td class="<#if item.zyxjl> success <#else>danger </#if>">${item.zyxjlres}</td>
                            </tr>
                        </#list>
                    </#if>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <h3>现金流三拷问</h3>
    <div class="row">
        <div class="col-md-10"><h4></h4>
        </div>
        <div class="col-md-2">
            <button type="button" class="btn btn-success btn-block" id="xjl-generate-excel"><i
                        class="fa fa-file-excel-o"
                        aria-hidden="true"></i>
                下载
            </button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-bordered table-striped table-hover" id="xjl_table">
                    <thead>
                    <tr>
                        <th></th>
                        <#-- 原始数据-->
                        <th colspan="8">原始数据</th>

                        <#-- 投资环节-->
                        <th colspan="2">1.投资环节</th>
                        <#--   <td>平均值</td>-->
                        <#-- 2.生产运营环节 >-->
                        <th>2.生产运营环节</th>
                        <#-- 3.销售环节 >-->
                        <th colspan="3">3.销售环节</th>

                    </tr>
                    <tr>
                        <th>年份</th>
                        <#-- 原始数据-->

                        <th>购建固定资产、无形资产及其他长期资产<br/>所支付的现金（资本开支）</th>
                        <th>自由现金流量</th>
                        <th>归属于母公司普通股股东的净利润</th>
                        <th>净现金周转天数(CCC)<br/>（净营业周期）</th>
                        <th>销售商品提供劳务收到的现金<br/>对营业收入的比率（收现率）</th>
                        <th>应收票据及应收账款</th>
                        <th>预收账款</th>
                        <th>营业收入</th>
                        <#-- 投资环节-->
                        <th>基本值</th>
                        <th>增长值</th>
                        <#--   <td>平均值</td>-->
                        <#-- 2.生产运营环节 >-->
                        <th>净营业周期</th>
                        <#-- 3.销售环节 >-->
                        <th>销售收现率</th>
                        <th>白条率</th>
                        <th>预收率</th>

                    </tr>
                    </thead>
                    <tbody>
                    <#if xjl??>
                        <#list xjl.list as item>
                            <tr>
                                <td>${item.year}年</td>
                                <td>${item.zbkz}</td>
                                <td>${item.zyxjll}</td>
                                <td>${item.gsmgsjly}</td>
                                <td>${item.jyyzq}</td>

                                <td>${item.sxl}%</td>
                                <td>${item.yspj}</td>
                                <td>${item.yszkk}</td>
                                <td>${item.yysy}</td>
                                <td>${xjl.jbz}</td>
                                <td>${xjl.zzz}</td>
                                <td>${item.jyyzq}</td>
                                <td>${item.sxl}%</td>
                                <td>${item.btl}%</td>
                                <td>${item.ysl}%</td>
                            </tr>
                        </#list>
                    </#if>
                    <#if xjl??>
                        <tr>

                            <td> 平均值</td>
                            <#-- 原始数据-->

                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <#-- 投资环节-->
                            <td></td>
                            <td></td>
                            <#--   <td>平均值</td>-->
                            <#-- 2.生产运营环节 >-->
                            <td class="danger">${xjl.jyyzqavg}</td>
                            <#-- 3.销售环节 >-->
                            <td class="danger">${xjl.sxlavg}%</td>
                            <td class="danger">${xjl.btlavg}%</td>
                            <td class="danger">${xjl.yslavg}%</td>
                        </tr>
                    </#if>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>

</body>
<script>
    $(document).ready(function () {

        $("#jczb-generate-excel").click(function () {
            var excel = new ExcelGen({
                "src_id": "jczb_table",
                "show_header": true,
                "file_name": "${stock.name}基础指标-基础数据.xlsx"
            });
            excel.generate();
        });

        $("#dlfx-generate-excel").click(function () {
            var excel = new ExcelGen({
                "src_id": "dlfx_table",
                "show_header": true,
                "file_name": "${stock.name}基础指标-定理分析数据.xlsx"
            });
            excel.generate();
        });
        $("#xjl-generate-excel").click(function () {
            var excel = new ExcelGen({
                "src_id": "xjl_table",
                "show_header": true,
                "file_name": "${stock.name}现金流-分析数据.xlsx"
            });
            excel.generate();
        });
        <#if xjl??>
            $('#xjl_table').tablesMergeCell({
                automatic: false,
                cols: [9, 10],
                rows: [<#list xjl.list as item>${item_index}<#if item_index!=xjl.list?size-1>, </#if></#list>]
            });
        </#if>
    });
</script>

</html>